</head>
<body>
	<div id="mc_background">
		<div id="mc_header">
			<div id="mc_logo"></div>
		</div>
	</div>
	<div id="mc_content">
		<?php if(CheckCurrentContest()) { ?>
			<div id="mc_new_validation" class="mc_box">
				<h3>Félicitations</h3>
				<h4>Vous venez de valider :</h4>
				<?php
					$lastvc = GetLastValidatedContests();
					foreach($lastvc as $c)
					{
						echo '<div><a href="' . MC_ROOT . 'contest.php?id=' . $c->id . '">' . stripslashes($c->title) . '</a><span class="mc_lvc_points">' . $c->points . ' pts</span></div>';
					}
					UpdateCurrentContest();
				?>
				<br />
				<a href="#" onclick="ToggleDisplay('mc_new_validation');return false;" style="float:right;margin-right:10px;">Fermer</a>
			</div>
			<script language="javascript" type="text/javascript"> DisplayNewValidation(); </script>
		<?php } ?>
		<a id="mc_logo_link" href="<?php echo MC_ROOT; ?>"></a>
		<?php if($mcuser->isadmin) { ?>
			<div id="mc_admin_msg_cont">
				<div class="mc_admin_msg_item" style="clear:both;font-size:.6em;text-align:center;"><a href="#" onclick="AdminNewMessage(); return false;">Nouveau</a> - <a href="#" onclick="AdminNewTodo(); return false;">Todo</a></div>
				<div id="mc_admin_msg">
				<?php
					include_once($mcrp . 'admin/messages.php');
					$msg = GetAllMessages();
					if($msg != null)
					{
						$i = 0;
						foreach($msg as $m)
						{
						?>
							<div class="mc_admin_msg_item <?php echo $m['txt'][3]; ?>" name="<?php echo $m['md5']; ?>"><span class="mc_admin_msg_del"><a href="#" onclick="AdminDelMessage(this);return false;">X</a></span><?php echo stripslashes($m['txt']); ?></div>
						<?php
							$i++;
						}
					}
				?>
				</div>
			</div>
		<?php } ?>
		<div id="mc_connection" class="mc_box">		
			<?php if($mcuser->id != 0)
			{
			?>
				<h3>Bienvenue <?php echo $mcuser->name; ?></h3>
				<div class="mc_box_content" id="mc_user_infos_box">
					<ul>
						<li><?php echo $mcuser->points; ?> points</li>
						<li>Classement : <?php echo $mcuser->rank; ?> e / <?php DisplayCacheContent('include/userscount.php', 60, array('userscount')); ?></li>
					</ul>
					<table>
						<tr><td><form method="post"><input type="submit" value="Déconnexion" name="logout" /></form></td>
						<td><form method="post" action="<?php echo MC_ROOT . 'profil.php'; ?>"><input type="submit" value="Profil" name="profil" /></form></td></tr>
					</table>
				</div>
			<?php
			}
			else
			{
				?>
				<div class="mc_box_content">
					<form id="mc_connection_form" method="post">
						<table>
							<tr>
								<td><label for="mc_pseudo">Pseudo :</label></td>
								<td><input id="mc_pseudo" class="mc_input_box" type="text" tabindex="1" name="username" size="17" /></td>
							</tr>
							<tr>
								<td><label for="mc_password">Mot de passe :</label></td>
								<td><input id="mc_password" class="mc_input_box" type="password" tabindex="2" name="password" size="17" /></td>
							</tr>
							<tr>
								<td colspan="2"><?php if(isset($loginerror)) echo "<font color=\"red\" size=\"3\"><b>$loginerror</b></font>"; ?></td>
							</tr>
							<tr>
								<td><input type="submit" name="login" tabindex="5" value="Connexion" onclick="LoginHash();" /></td>
								<td><a href="<?php echo MC_ROOT . 'register.php'; ?>">S'inscrire</a></td>
							</tr>
						</table>
						<input type="hidden" name="islogin" />
						<input id="mc_sha1" type="hidden" name="sha1" />
					</form>
				</div>
			<?php } ?>
		</div>
		
		<div id="mc_menu_top">
			<div id="mc_menu_btn_epreuves" class="mc_test"><a href="<?php echo MC_ROOT . 'contests.php'; ?>"></a></div>
			<div id="mc_menu_btn_nano" class="mc_test"><a href="<?php echo MC_ROOT . 'nano.php'; ?>"></a></div>
			<div id="mc_menu_btn_forum" class="mc_test"><a href="<?php echo MC_ROOT . 'forum'; ?>"></a></div>
			<div id="mc_menu_btn_pour_debuter" class="mc_test"><a href="<?php echo MC_ROOT . 'begin.php'; ?>"></a></div>
			<div id="mc_menu_btn_telechargements" class="mc_test"><a href="<?php echo MC_ROOT . 'download.php'; ?>"></a></div>
			<?php if($mcuser->isadmin) { ?>
			<div id="mc_lang_flags"><a href="?lang=fr&next=<?php echo $_SERVER['REQUEST_URI']; ?>"><img src="<?php echo MC_ROOT . 'img/fr_flag.png'; ?>"></a><a href="?lang=en&next=<?php echo $_SERVER['REQUEST_URI']; ?>"><img src="<?php echo MC_ROOT . 'img/en_flag.png'; ?>"></a></div>
			<?php } ?>
		</div>
		
		<div id="mc_menu_left">
			<div class="mc_box">
				<h3>Catégories</h3>
				<div class="mc_box_content">
					<ul id="mc_left_cat_list">
					<li><a href="<?php echo MC_ROOT . 'contests.php?id=-1'; ?>">Tous les épreuves</a></li>
					<div style="height:6px;"></div>
					<?php DisplayCacheContent('include/categorieslistbox.php', 60, array('categorieslist')); ?>
					</ul>
				</div>
			</div>
			
			<div class="mc_box">
                <h3>Menu</h3>
                <ul>
					<li><a href="<?php echo MC_ROOT . 'nano.php'; ?>">Nanocontest<sup> <i>beta</i></sup></a></li>
                    <li><a href="<?php echo MC_ROOT . 'register.php'; ?>">S'inscrire</a></li>
					<li><a href="<?php echo MC_ROOT . 'download.php'; ?>">Télécharger la lib µContest</a></li>
					<li><a href="<?php echo MC_ROOT . 'law.php'; ?>">Loi d'attribution des points</a></li>
					<li><a href="<?php echo MC_ROOT . 'partner.php'; ?>">Partenaires</a></li>
                </ul>
            </div>
			
			<?php
			if($mcuser->isadmin)
			{
			?>
				<div class="mc_box">
					<h3>Administration</h3>
					<ul>
						<li><a href="<?php echo MC_ROOT . 'admin/contests.php'; ?>">Concours</a></li>
						<li><a href="<?php echo MC_ROOT . 'admin/categories.php'; ?>">Catégories</a></li>
						<li><a href="<?php echo MC_ROOT . 'admin/users.php'; ?>">Utilisateurs</a></li>
						<li><a href="<?php echo MC_ROOT . 'log/try.php'; ?>">Log essais</a></li>
						<li><a href="<?php echo MC_ROOT . 'log/login.log'; ?>">Log connexions</a></li>
					</ul>
                </div>
			<?php
			}
			?>
			
			<div class="mc_box" style="margin-bottom: 15px;">
				<h3>Statistiques</h3>
				<div class="mc_box_content" id="mc_left_stats">
					<h5>Top 5</h5>
					<table id="mc_left_classification">
					<?php DisplayCacheContent('include/top5.php', 60); ?>
					</table>
					<div style="width:100%;text-align:center;"><a href="<?php echo MC_ROOT . 'rank.php'; ?>">Classement complet</a></div>
				</div>
			</div>
		</div>
		<div id="mc_container">